clc
clear all
close all
a=[];
b=[];
c=[];
d=[];
e=[];
f=[];
obj_pos=[];
N=100;
M=100;
torres_pos=[];
for i=1:M
    pos=2*(rand(N,3)-0.5);
    torres=2*(rand(1,12)-0.5);
    r1=sqrt((pos(:,1)-torres(1,1)).^2 + (pos(:,2)-torres(1,2)).^2 + (pos(:,3)-torres(1,3)).^2);
    r2=sqrt((pos(:,1)-torres(1,4)).^2 + (pos(:,2)-torres(1,5)).^2 + (pos(:,3)-torres(1,6)).^2);
    r3=sqrt((pos(:,1)-torres(1,7)).^2 + (pos(:,2)-torres(1,8)).^2 + (pos(:,3)-torres(1,9)).^2);
    r4=sqrt((pos(:,1)-torres(1,10)).^2 + (pos(:,2)-torres(1,11)).^2 + (pos(:,3)-torres(1,12)).^2);
    a=[a; (r1-r2)];
    b=[b; (r1-r3)];
    c=[c; (r1-r4)];
    d=[d; (r2-r3)];
    e=[e; (r2-r4)];
    f=[f; (r3-r4)];    
    obj_pos=[obj_pos; pos];
    torres_pos=[torres_pos; repmat(torres,N,1)];
end
% pos=2*(rand(N,12)-0.5);
% 
% r1=sqrt((pos(:,1)-pos(:,4)).^2 + (pos(:,2)-pos(:,5)).^2 + (pos(:,3)-pos(:,6)).^2);
% r2=sqrt((pos(:,1)-pos(:,7)).^2 + (pos(:,2)-pos(:,8)).^2 + (pos(:,9)-pos(:,6)).^2);
% r3=sqrt((pos(:,1)-pos(:,10)).^2 + (pos(:,2)-pos(:,11)).^2 + (pos(:,12)-pos(:,6)).^2);
% 
% 
entradas=[torres_pos a b c d e f];
salidas=obj_pos;